import {type FC} from 'react'
import type { QuestionParagraphPropsType } from '@/utils/type'
import { defaultParagraphProps } from '@/utils/default'






const  QuestionParagraph: FC<QuestionParagraphPropsType> = (props:QuestionParagraphPropsType)=> {
  const {text='',isCenter} = {...defaultParagraphProps,...props}


  const textList = text.split('\n')

  return (
    <div  style={{textAlign: isCenter ? 'center' : 'left'}}>
      {textList.map((item,index)=>(
        <span key={index}>
          {index>0 && <br/>}
          {item}
        </span>
      ))}
    </div>
  )
}


export default QuestionParagraph
